set(MODULE_y)

if(NOT LOSCFG_INTERRUPT_VENDOR)
    list(APPEND MODULE_y interrupt)
endif()

if(NOT LOSCFG_TIMER_VENDOR)
    list(APPEND MODULE_y timer)
endif()

if(LOSCFG_DRIVERS_UART_LINUX)
    list(APPEND MODULE_y uart_linux)
elseif (LOSCFG_DRIVERS_UART_LITEOS)
    list(APPEND MODULE_y uart)
endif()

list(APPEND MODULE_${LOSCFG_DRIVERS_BASE} base)

list(APPEND MODULE_${LOSCFG_DRIVERS_GPIO} gpio)
list(APPEND MODULE_${LOSCFG_DRIVERS_I2C} i2c)
list(APPEND MODULE_${LOSCFG_DRIVERS_RTC} rtc)
list(APPEND MODULE_${LOSCFG_DRIVERS_SPI} spi)

list(APPEND MODULE_${LOSCFG_DRIVERS_HIDMAC} hidmac)
list(APPEND MODULE_${LOSCFG_DRIVERS_HIEDMAC} hiedmac)
list(APPEND MODULE_${LOSCFG_DRIVERS_HIETH_SF} hieth-sf)

list(APPEND MODULE_${LOSCFG_DRIVERS_MEM} mem)
list(APPEND MODULE_${LOSCFG_DRIVERS_RANDOM} random)
list(APPEND MODULE_${LOSCFG_DRIVERS_VIDEO} video)

list(APPEND MODULE_${LOSCFG_DRIVERS_MTD} mtd)
list(APPEND MODULE_${LOSCFG_DRIVERS_MMC} mmc)
list(APPEND MODULE_${LOSCFG_DRIVERS_USB} usb usb/phy)
list(APPEND MODULE_${LOSCFG_DRIVERS_USB_DWC_DRIVER} usb/gadget)
list(APPEND MODULE_${LOSCFG_DRIVERS_CIPHER} cipher)
list(APPEND MODULE_${LOSCFG_DRIVERS_IOMMU} iommu)

FOREACH(CUR_MODULE_y ${MODULE_y})
    add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/${CUR_MODULE_y})
ENDFOREACH(CUR_MODULE_y)
